<template>
	<view class="back">
		<view class="title">
			<view class="login-close" @click="goBack">
				<text class="icon icon-close"></text>
			</view>	
			<text class="title-text">iDOCK</text>
		</view>
		<view class="title-body">
			连通陆地和海洋
		</view>
		<view  class="title2">
			Connecting land and sea
		</view>
		<view class="img">
			<u-image  mode="scaleToFill" width="100%" height="737rpx"  src="/static/images/home.png"></u-image>
		</view>
		<view class="button">
			<view class="login"  @click="$goPage('/login', {}, true)">登录</view>
			<view class="register" @click="$goPage('/sign-in', {}, true)" >注册</view>
		</view>
	</view>
</template>

<script>
	import {
		defineComponent,
		reactive,
		toRefs,
		ref,
		computed,
		onMounted,
		getCurrentInstance,
	} from "vue";
	import { useRouter } from 'vue-router';
	export default defineComponent ({
		setup(){
			const router = useRouter();
			const pages = getCurrentPages()
			data : reactive({
				
			});
			const goBack =() => {
				if (pages.length > 1) {
					uni.$u.route({
					    type:'back',
					    delta:1
					})
				} else {
					router.push({ path: '/pages/login/index' })
				}
			};
			return {
				goBack
			}
		}
	})
</script>

<style lang="scss">
	.back{
		background-color: #FEFEFE;
		width: 100%;
		height: 100vh;
		border-top: 1rpx solid #fff;
	}
	.title{
		display: flex;
		text-align: center;
		width: 100%;
		margin-top: 88rpx;
		.login-close {
			width: 48rpx;
			height: 48rpx;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			margin-left: 48rpx;
			.icon {
				width: 32rpx;
				height: 32rpx;
				font-size: 32rpx;
				color: #000000;
			}
		}
		.title-text{
			position: absolute;
			width: 116rpx;
			height: 50rpx;
			font-size: 36rpx;
			font-family: PingFang HK-Medium, PingFang HK;
			color: #0F172A;
			left: 50%;
			transform:translateX(-50%);
		}
	}


	.title-body{
		width: 100%;
		height: 113rpx;
		text-align: center;
		margin-top: 97rpx;
		font-size: 75rpx;
		font-family: Source Han Sans CN-Bold, Source Han Sans CN;
		font-weight: bold;
		color: #000000;
	}
	.title2{
		width: 100%;
		height: 47rpx;
		font-size: 31rpx;
		font-family: Source Han Sans CN-Regular, Source Han Sans CN;
		font-weight: 400;
		color: rgba(0, 0, 0, 0.5);
		line-height: 37rpx;
		text-align: center;
	}
	.img{
		width: 100%;
		margin-top: 20rpx;
	}
	.button{
	  height: 108rpx;
  	padding: 65rpx;
		.login{
			line-height: 108rpx;
			height: 108rpx;
			background: #476BEE;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			text-align: center;
			font-size: 38rpx;
			color: #FEFEFE;
		}
		.register{
			margin-top: 20rpx;
			height: 108rpx;
			background: #000000;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			text-align: center;
			line-height: 108rpx;
			font-size: 38rpx;
			color: #FEFEFE;
		}
	}
</style>
